<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class DataScopeSeeder extends Seeder
{

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('data_scopes')->insert(array(
            ['id' => 1, 'parent_id' => null, 'full_title' => '公司', 'title' => '公司', 'code' => 'gongsi', 'data_scope' => '01', 'description' => '公司', 'created_at' => DB::raw('now()')],
            ['id' => 2, 'parent_id' => 1, 'full_title' => '公司\信息域', 'title' => '信息域', 'code' => 'xinxi', 'data_scope' => '0101', 'description' => '信息域', 'created_at' => DB::raw('now()')],
            ['id' => 3, 'parent_id' => 1, 'full_title' => '公司\医学域', 'title' => '医学域', 'code' => 'yixue', 'data_scope' => '0102', 'description' => '医学域', 'created_at' => DB::raw('now()')],
            ['id' => 4, 'parent_id' => 1, 'full_title' => '公司\销售域', 'title' => '销售域', 'code' => 'xiaoshou', 'data_scope' => '0103', 'description' => '销售域', 'created_at' => DB::raw('now()')],
            ['id' => 5, 'parent_id' => 1, 'full_title' => '公司\生产域', 'title' => '生产域', 'code' => 'shengchan', 'data_scope' => '0104', 'description' => '生产域', 'created_at' => DB::raw('now()')],
            ['id' => 6, 'parent_id' => 1, 'full_title' => '公司\总裁域', 'title' => '总裁域', 'code' => 'zongcai', 'data_scope' => '0105', 'description' => '总裁域', 'created_at' => DB::raw('now()')],
        ));

        DB::table('user_group_map_user')->insert(array(
            ['group_id' => 1, 'user_id' => 1, 'created_at' => DB::raw('now()')],
            ['group_id' => 1, 'user_id' => 2, 'created_at' => DB::raw('now()')],
            ['group_id' => 1, 'user_id' => 3, 'created_at' => DB::raw('now()')],
            ['group_id' => 1, 'user_id' => 4, 'created_at' => DB::raw('now()')],
            ['group_id' => 1, 'user_id' => 5, 'created_at' => DB::raw('now()')],
            ['group_id' => 1, 'user_id' => 6, 'created_at' => DB::raw('now()')],
            ['group_id' => 1, 'user_id' => 7, 'created_at' => DB::raw('now()')],
            ['group_id' => 1, 'user_id' => 8, 'created_at' => DB::raw('now()')],
        ));
    }

}
